package com.atguigu.gmall.product.service.impl;

import com.atguigu.gmall.common.util.JSONs;
import com.atguigu.gmall.item.to.CategoryView;
import com.atguigu.gmall.item.to.SkuDetailTO;
import com.atguigu.gmall.product.to.CategoryTree;
import com.atguigu.starter.cache.annotation.GmallCache;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.atguigu.gmall.product.entity.BaseCategory1;
import com.atguigu.gmall.product.service.BaseCategory1Service;
import com.atguigu.gmall.product.mapper.BaseCategory1Mapper;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;

import java.util.List;

/**
* @author lfy
* @description 针对表【base_category1(一级分类表)】的数据库操作Service实现
* @createDate 2023-08-14 16:26:08
*/
@Service
public class BaseCategory1ServiceImpl extends ServiceImpl<BaseCategory1Mapper, BaseCategory1>
    implements BaseCategory1Service{


    @Autowired
    StringRedisTemplate redisTemplate;





    @GmallCache(key = "categorys")
    @Override
    public List<CategoryTree> getCategoryTreeData() {

        return baseMapper.getCategoryTreeData();
    }

    @Override
    public CategoryView getCategoryView(Long c3Id) {
        return baseMapper.getCategoryView(c3Id);
    }
}




